package com.shopping.utils;

import lombok.experimental.UtilityClass;
import org.thymeleaf.util.StringUtils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

@UtilityClass
public class ValidataUtils {

    private final Pattern pattern=Pattern.compile("1\\d{10}");

    public boolean isMobile(String mobile){
        if(StringUtils.isEmpty(mobile)){
            return false;
        }
        Matcher matcher = pattern.matcher(mobile);
        return matcher.matches();
    }


//    public static void main(String[] args) {
//        System.out.println(isMobile("12345678909"));
//        System.out.println(isMobile("1111"));
//    }
}
